#include <stdio.h>

int main(int argc, char *argv[]) {

    int n = 0;
    scanf("%d", &n);
    int flag = 1;

    for (size_t i = 2; i <= n; i++){
        for (size_t z = 2; z < i; z++){
            //出现其它因数
            if (i % z == 0)
                flag = 0;
        }
        if(flag)
            printf("%lld ", i);
        flag =1;
    }
    

    return 0;
}